<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>属性选择器</title>
        <style>
            [target]{
                background: pink;
                width: 200px;
                height: 50px;
                margin-bottom: 20px;
            }
            [target^="da"]{
                width: 100px;
                height: 50px;
                margin-bottom: 20px;
                background: red;
            }
            [target$="fds"]{
                width: 100px;
                height: 50px;
                margin-bottom: 20px;
                background: blue;
            }
            [targets*="fd"]{
                width: 100px;
                height: 50px;
                margin-bottom: 20px;
                background: peru;
            }
            #dd{
                width: 500px;
                height: 500px;
                border: 2px solid black;
            }
            #dd::after{
                content:"";
                width: 200px;
                height: 200px;
                background: peru;
                display: block;
            }
            #dd:hover{
                border-color: red;
            }
            #dd:hover::after{
                background: blue;
            }
        </style>
    </head>
    <body>
        <!--自定义的属性选择器-->
        <p target></p>
        <!--以XXX开头的选择器-->
        <p target="dadfd"></p>
        <!--以XXX结尾的选择器-->
        <p target="aadfds"></p>
        <!--包含XXX的选择器-->
        <p targets="dadfd"></p>
        <p id="dd">1</p>
    </body>
</html>